<template>
	<view class="container">
		<view class="title">{{title}}</view>
		<view v-html="content" class="content">
		</view>
	</view>
</template>

<script>
import http from '@/common/request.js';
import Loading from '@/components/notice/loading.vue';
export default {
	onLoad(option) {
		this.id = option.id
	},
	data() {
		return {
			id: '',
			title: '',
			content: ''
		};
	},
	mounted() {
		this.detail()
	},
	methods: {
		detail() {
			http('/api/cusMessageNotice/' + this.id, { method: 'GET' }).then(result => {
				const data = result.data || {};
				let richtext = data.noticeContent || ''
				let regex = new RegExp('<img', 'gi');
				richtext = richtext.replace(regex, `<img style="width: 100%!important;height: auto!important;"`);
				this.title = data.noticeTitle || '';
				this.content = richtext;
			});
		}
	}
};
</script>

<style lang="less" scoped>
.container {
	padding: 0rpx 40rpx 40rpx 40rpx;
	background: #fff;
	min-height: 100vh;
	.title {
		padding: 23rpx 0;
		text-align: center;
		margin-bottom: 40rpx;
	}
	.content {
		font-size: 28rpx;
		font-weight: 300;
		color: #8a8c8d;
		line-height: 46rpx;
		img {
			margin: 24rpx 0;
		}
		margin-bottom: 24rpx;
	}
}

</style>
